package com.xbongbong.pro.enums.errorcodes;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;

/**
 * api错误枚举
 * @author haibnin
 */
@Getter
public enum ApiErrorCodeEnum implements ErrorCode {
    API_ERROR_700001(700001, "enum.errorCode.msg.api_error_700001"),
    API_ERROR_700002(700002, "enum.errorCode.msg.api_error_700002"),
    API_ERROR_700003(700003, "enum.errorCode.msg.api_error_700003"),
    API_ERROR_700004(700004, "enum.errorCode.msg.api_error_700004"),
    API_ERROR_700005(700005, "enum.errorCode.msg.api_error_700005"),
    ;
    /**
     * 错误码
     */
    private final int code;
    /**
     * 错误描述
     */
    private final String msg;

    ApiErrorCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;

    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return I18nMessageUtil.getMessage(msg);
    }
}
